<?php
namespace app\admin\controller;
use app\BaseController;
use think\facade\Db;
class Form extends Base{
    public function list_data(){
        $listData = Db::table('an_form')->order('id', 'dsc')->select()->toArray(); 
        foreach($listData as $k=>$v){
            $listData[$k]['create_time'] = date("Y-m-d G:i",$v['create_time']);
        }
        $this->assign('listData',json_encode($listData));
        return $this->fetch();
    }

    public function form_del_data(){
        $pt = input("post.");
        $bool = Db::table('an_form')->where('id',$pt['id'])->delete();
        $this->logData('删除留言:'.$pt['id']);
        $this->info['code']=1;
        return json($this->info);
    }
}
